package com.Lubaichen.Wiki.service;

import com.Lubaichen.Wiki.Pojo.Doc;
import com.Lubaichen.Wiki.mapper.DocMapper;
import com.Lubaichen.Wiki.websocket.WebSocketServer;
import org.slf4j.MDC;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Lubaichen
 * @date 2022年04月17日 22:16
 */
@Service
public class WebSocketService {
    @Resource
    private WebSocketServer webSocketServer;


    @Async
    public void sendInfo(String str, String logId) {
        MDC.put("LOG_ID", logId);
        webSocketServer.sendInfo(str);
    }
}
